package com.shr.code_interview;

import java.util.Stack;

public class Solution_30 {
	private Stack<Integer> stack = new Stack<>() ;
	private Stack<Integer> sortStack = new Stack<>() ;
	
    public void push(int node) {
        stack.push(node) ;
        sortStack.push(Math.min(node, min())) ;
    }
    
    public void pop() {
        stack.pop();
        sortStack.pop();
    }
    
    public int top() {
        return 0;
    }
    
    public int min() {
    	if(sortStack.size()>0)
    		return sortStack.peek();
    	else return Integer.MAX_VALUE ;
    }
}
